﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;

namespace Knjiga
{
    public class Global : System.Web.HttpApplication
    {

        
        
        protected void Application_Start(object sender, EventArgs e)
        {
            Application["Posete"] = 0;
            Application["Sesije"] = 0;
            Application["PrekSesije"] = 0;
        }

        protected void Session_Start(object sender, EventArgs e)
        {
            Application.Lock();
            Application["Sesije"] = (int)Application["Sesije"] + 1;
            Application.UnLock();
        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {
            Application.Lock();
            Application["Posete"] = (int)Application["Posete"] + 1;
            Application.UnLock();
        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {
            Application.Lock();
            Application["PrekSesije"] = (int)Application["PrekSesije"] + 1;
            Application.UnLock();
        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
        
    }
}